// import { combineReducers } from "redux";
import commonData from "./data";


const reducer = (state = commonData, action) => {
    switch (action.type) {
        case "SHOW_ALERT":
            return Object.assign({}, state, {
                showAlert: action.data
            });
        default:
            return state;
    }
}

/**
 * 如果有多个reducer函数，则可以使用combineReducers进行合并
 *export default combineReducers({
     reducer1,
     reducer2
 })
 */
export default reducer;